﻿using System;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Abp.Application.Services.Dto;
using Abp.Extensions;
using LeadThing.AbpZeroTemplate.Articles;

namespace LeadThing.AbpZeroTemplate.Articles.EntityMapper.Articles
{

    /// <summary>
    /// 文章的数据配置文件
    /// </summary>
    public class ArticleCfg : EntityTypeConfiguration<Article>
    {
        /// <summary>
        ///  构造方法[默认链接字符串< see cref = "AbpZeroTemplateDbContext" /> ]
        /// </summary>
        public ArticleCfg()
        {
            ToTable("Article", AbpZeroTemplateConsts.SchemaName.Basic);


            // 调用别名
            Property(a => a.CallIndex).HasMaxLength(4000);
            // 标题
            Property(a => a.Title).HasMaxLength(100);
            // 外部链接
            Property(a => a.LinkUrl).HasMaxLength(4000);
            // SEO标题
            Property(a => a.SeoTitle).HasMaxLength(500);
            // SEO关健字
            Property(a => a.SeoKeyWords).HasMaxLength(500);
            // SEO描述
            Property(a => a.SeoDescription).HasMaxLength(500);
            // 内容摘要
            Property(a => a.ContentAbstract).HasMaxLength(500);
        }
    }
}